package net.asfun.jvalog.vo;

import java.util.Date;

import net.asfun.jvalog.common.InteractException;
import net.asfun.jvalog.entity.Paper;

public class Page {

	private Paper paper;
	
	public Page(Paper paper) {
		if ( paper == null ) {
			throw new InteractException("Page not found");
		}
		this.paper = paper;
	}

	public boolean isPublished() {
		return paper.isPublished();
	}

	public String getArticle() {
		return paper.getContent().getValue();
	}

	public Date getDate() {
		return paper.getDate();
	}
	
	public Long getId() {
		return paper.getKey().getId();
	}
	
	public String getLink() {
		return Site.getInstance().getUrl() + paper.getUri() + ".html";
	}

	public String getTitle() {
		return paper.getTitle();
	}

	public String getSlogan() {
		return paper.getSlogan();
	}

	public String getExcerpt() {
		return paper.getExcerpt();
	}
}
